home *** CD-ROM | disk | FTP | other *** search
/ Hackers Matrix / Hacker's Matrix (nCite Software) (2003).iso / Tutorials / hTut_0211.txt < prev    next >
Text File  |  2002-12-13  |  14KB  |  229 lines

  1.     This is a document describing the user account settings and information that are common with windows xp/2k.
  2.         I'll teach you how to set up a user account using only the command prompt. These can be used in variety of
  3.         useful(or useless) ways such as merging them into batch files or Visual Basic programs (visual basic has it's obvious
  4.         setbacks, but it's okay for quick, easy development of small programs).
  5. First off, I'd like to discuss how to set up a user account, and a few of the most common options and commands associated with doing so.
  6. Even though it's quite easy just to sit down as administrator at a computer, click a couple times, type in a password, and have a working 
  7. user account, sometimes you don't have that GUI to work with. Say, for instance, you wanted to create a small utility that would automate the
  8. process of setting up user accounts on a network. And lets say this network is about 1500 miles away. How would you do this? You probably 
  9. wouldn't fly over to the network, and visit each individual node. No, you'd want a program that you could do this with without actually being 
  10. there! Here's were these commands come in. Try these commands as you read them.
  11.     NOTE: All the output of all these commands can be sent to a file by simply adding >filename.txt to the very end of the command
  12.  
  13.     I actually go over many of XP/2k's "net" commands. these include sharing out folders, adding usernames/accounts, setting priviliges,
  14. starting/stopping network services, and allowing programs to run as a certain user.
  15. 1) The NET USER commands
  16.     NET USER is how windows XP/2k adds users to a computer, as well as changes passwords and setting options. You can only set up limited
  17.     accounts using NET USER, but I'll explain how to make them admin later in the document.
  18.     COMMANDS:
  19.     /add            -adds the user. ONLY USE IF THE ACCOUNT DOESN'T EXIST AND YOU WANT TO CREATE IT.
  20.     /domain            -performs the operation on the domain controller (only if the computer is a domain controller)
  21.     /Active:YES/NO        -Specifies whether or not the account is able to accept logins (active or not)
  22.     /comment:"Comment text"    -Leaves a comment. I'd put things like when i made the account/what computer/and why.
  23.     /countrycode:nnn    -country code. It's supposed to load the language files for that country, however you may have to have the 
  24.                 language files installed on your computer in order to use this feature.
  25.     /expires:NEVER        -expiration date of the account. once the date hits, goodbye account. also takes 
  26.                 mm/dd/yyyy;dd/mm/yyyy;mmm/dd/yyy formats.
  27.     /fullname:"name"    -the full name of the user.
  28.     /homedir:path        -the path of the user's home directory. it will NOT create a directory, it has to already exist.
  29.     /passwordchg:YES/NO    -allows/disallows user to change their own password
  30.     /passwordreq:YES/NO    -specifies if there is a password required.
  31.     /profilepath:path    -points to the profile path in the registry.
  32.     /scriptpath:path    -path to the user's login script. can't be an abosulte path. must be something like:
  33.                 %systemroot%\system32\Repl\Import\Scripts
  34.     /times:all        -VERY COOL. opens up a little window in time where you have a chance to use the account. if you try and
  35.                 log in at any other time(s) than those specified, you won't be able to. limited to 1hour increments. To
  36.                 set up a user account that can only be accessed on mondays between 4am and 5am, and wednesdays through 
  37.                 fridays between 12noon and 6pm, use this:
  38.                 net user USERNAME /times:M,4AM-5AM;W-F,12PM-6PM
  39.                 (abberviations used(you can also spell them out)): M,T,W,Th,F,Sa,Su
  40.     /usercomment:"comment"    -specifies that an admin can change the user comments for that account.
  41.     /workstations:*        -Okay. this one's kinda  cool in itself. You can list up to 8 workstations that can log in as this account
  42.                 or use the * asterisk to allow ANY computer to log in as that account.
  43.                 example: net user USERNAME /workstations:MyPC1,MyPc2,MyPC3
  44.     /delete            -removes the account.
  45.  
  46.         EXAMPLES:
  47.             
  48.     To create a simple limited account for the user "USER" with the password being PASSWORD:
  49.         net user USER PASSWORD /add
  50.     To change the password for the account USER to a more secure password, such as CF43KF923K
  51.         net user USER CF43KF923K
  52.     To Remove the account:
  53.         net user USER /delete
  54.     To make the account USER again, give it the password PASSWORD, disallow password changing, set the login times to Thursdays between
  55.     11am and 3pm, and to allow ANY user from any machine to log in:
  56.         net user USER PASSWORD /add /passwordchg:NO /times:Th,11am-3pm /workstations:*
  57. Now that we have a good understanding of that, we'll move on. 
  58.  
  59. 2) Now the net localgroup settings. These allow you to change the groups(access rights) in which an account is assigned.
  60.     
  61.     /comment:"Comment"    -Adds a comment for a new or existing group.
  62.     /domain            -performs the operation on the domain controller
  63.     /add            -makes the group OR adds a user to the group. Say you wanted to make a new group "MYGROUP"
  64.                 net localgroup MYGROUP /add
  65.                 then add an existing user to that group:
  66.                 net localgroup MYGROUP USER /add
  67.     /delete            -removes a group or user from a group
  68.     NOTE: The name(s) you add to a group must be seperated with a space.
  69.     COMMON GROUPS: (found using net localgroup:
  70.         Administrators        -all access to all types of options
  71.         Backup Operators    -A type of local or global group that contains the user rights you need to back up and restore files 
  72.                     and folders. Members of the Backup Operators group can back up and restore files and folders 
  73.                     regardless of ownership, permissions, encryption, or auditing settings.
  74.         Debugger Users
  75.         Guests            -very limited accounts.
  76.         HelpServiceGroup
  77.         Network Configuration Operators
  78.         Power Users
  79.         Remote Desktop Users
  80.         Replicator
  81.         Users            -fairly limited accounts. all permissions specified by admin
  82.     EXAMPLE:    
  83.         Set up the user account "USER" to be an administrator:
  84.             net localgroup Administrator USER /add
  85. 3) And now for the net view command! This one allows you to see a list of the domains/shares/and/or resources being shared by a computer.
  86.     \\IP or NAME        -shows the shared resources you want to view
  87.     /domain            -specifies the domain for which you want to view available computers if you don't use this, it'll show all
  88.                 the domains on the network
  89.     /network:sw        -displays all the available servers on A NetWare network.
  90.     EXAMPLE:
  91.         View all the shares (both resource and NetBIOS/BEUI on the local machine
  92.             net view \\127.0.0.1
  93.             or
  94.             net view \\MYMACHINENAME
  95.  
  96. 4) Net Accounts. A wonderful little command that updates the user accounts database and modifies password and logon requirements for ALL accounts.
  97.     /forcelogoff:NO        -sets the number of minutes to wait before ending a user's session with the server. 
  98.     /minpwlen:number    -the minimum password length for all accounts
  99.     /maxpwage:Unlimited    -sets the number of days a user's password is valid. has to be longer than minpwage
  100.     /minpwage:days        -This sets the number of days MINIMUM ebfore a user can change their password. Theorectically you can set it
  101.                 to UP TO 49,710 days.
  102.     /uniquepw:number    -user can't repeat password for the specified number of password changes.
  103.     /domain            -performs the operation on the domain controller, otherwise it'll only be performed on the local machine
  104.     
  105.     EXAMPLE:
  106.         Make all accounts have a MINIMUM password length of 6 and a MAXIMUM password length of 14, and they must change it every
  107.         12 days.
  108.     net accounts /winpwlen:6 /macpwlen:14 maxpwage:12
  109.  
  110. 5) The NET USE command connects and/or disconnects a user from a shared resource, as well as displays info about the connections.
  111.     Devicename        -assigns a name to connect to the resource(disk and print only) or specifies the device to be disconnected.
  112.     \\IP\sharename        -Specifies the computer name(in place of IP) and the shared resource.
  113.     \volume            -Specifies the NetWare Volume on the server. have to have client service for netware installed and running.
  114.     password        -the password needed to connect to the shared resource. use * to make a prompt for the pass.
  115.     \user            -specifies a different name with which the connection will be made
  116.     DomainName        -specifies another domain
  117.     UserName        -specifies the user name with which to log on
  118.     DottedDomainName    -specifies fully-qualified domain name for the domain where the user accont exists.
  119.     /savecred        -stores provided credntials for resuse
  120.     /smartcard        -network connection is to use credentials on a smart card
  121.     /delete            -cancels specified network connect. use * asterisk to cancel ALL network connections.
  122.     /Persisntant:YES/NO    -YES saves all conneions as they are made, NO does not.
  123.     /home            -connects to the home directory
  124.     
  125.     EXAMPLE:
  126.         COnnect to 4.64.115.255 share MyShare
  127.     net use \\4.64.115.255\MyShare
  128.         Disconnect from MyShare
  129.     net use \\4.64.115.255\MyShare /delete
  130.         Map (add the drive to My Computer) networked drive
  131.     net use * \\4.64.115.255\MyShare
  132.  
  133. 6) Net Session is used to view/disconnect from connections
  134.     \\ip            -lists connections
  135.     /delete            -dosconnects connection
  136.     
  137.     EXAMPLE:
  138.         view all network connections
  139.     net session
  140.         Disconnect all network sessions
  141.     net session /delete        
  142.         delete only only specified connection 4.64.115.255
  143.     net session 4.64.115.255 /delete
  144.  
  145. 7) Net Group is for adding, displyaing, or modifying global groups in DOMAINS only
  146.     groupname        -specifies the name of the group to add/exapnd/or remove.
  147.     /comment:"comment"    -adds a comment. wow what a surprise there.
  148.     /domain            -performs the operation on the domain controller/otherwise just on local machine
  149.     /add            -adds a group (or user) to the group.
  150.     /delete            -removes a group or user from the group.
  151.  
  152.     EXAMPLE:    
  153.         To add a new group MYGROUP to the domain:
  154.     net group MYGROUP /add /domain
  155.         to add a few new users NEWUSER1, NEWUSER2, and NEWUSER3 to the group
  156.     net group MYGROUP NEWUSER1 NEWUSER2 NEWUSER3 /add
  157.  
  158. 8) Net share is for managing shared resources. Say, for example, you wanted to share/disallow a shared resource (netBIOS)
  159.     /users:number        -maximum number of users on shared resource at any one time
  160.     /unlimited        -unlimited users on shared directory at any one time
  161.     /remark:"Text"        -leaves a comment on the share
  162.     /cache:mode        -Automatic:enables offline client caching with automatic reintegration
  163.                 manual: enables offline lient caching with manual reintegration
  164.                 no: advises client that offline cahcing is not appropriate :)
  165.     /delete         -removes share
  166.     
  167.     EXAMPLE:
  168.         To share the entire F: directory
  169.     net share SHARENAME=F:\
  170.         To stop sharing F:
  171.     net share SHARENAME /delete
  172.         NOTE: If you do share a folder using net share, it is my experience that it gives complete read/write access to the share :)
  173.  
  174. 9) Net Stop / Net Start / Net Pause /Net Continue start and stop or pause network services. Services that can be paused have an *asterisk 
  175. next to them
  176. These include:
  177.     -alerter            warns about access and security issues.
  178.     -browser            maintains up-to-datelist of computers on the network and list of programs that request it
  179.     -"Client Service for netware"    only if it's installed
  180.     -clipbook            cut/copy/paste text/graphics/docs over network
  181.     -dhcp client            can't stop this service
  182.     -file replication        file replication service
  183.     -messenger            enables computer to recieve messages.
  184.        *-netlogon            verifies logon requests and controls domain-wide replication
  185.        *-"nt LM security suppoert provider"    Only if it's installed
  186.     -"Remote Access Connection Manager"    only if it's installed
  187.     -"Routing and remote access"    starts/stops this service
  188.     -rpclocator            allows distributd application to use the RPC name service
  189.        *-schedule            task scheduler
  190.        *-server                share server resources over network
  191.     -spooler            print spool service.
  192.     -"TCP/IP NetBIOS Helper"    enables NetBIOS over TCP/IP
  193.     -UPS                Uninterruptable power supply
  194.        *-Workstation            if stopped, computer can't access networked resources
  195.  
  196. 10) net name is used in conjunction with the messenger service. the messenger service must be started for messages to be recieved/sent. 
  197.     NAMES CAN ONLY BE UP TO 15 CHARACTERS!
  198.     /add            -adds a name or "alias" to the messenger service not required
  199.     /delete            -removes an alias from the messenger service
  200.  
  201.     EXAMPLE:
  202.         once the messenger service is started, view all names in messenger service:
  203.     net name
  204.         once the messenger service is started, add a name "USERNAME" to your service:
  205.     net name USERNAME
  206.         remove name "USERNAME" from messenger service
  207.     net name USERNAME /delete
  208.  
  209. 11) net print is used to view/delay/or cancel print jobs in a print queue
  210.     \\ip            -REQUIRED. can be computer name
  211.     \QueueName        -if no specified queue, lists all of them
  212.     /hold            -delays the job, allowing other jobs to pass it
  213.     /release        -realeases /hold job
  214.     /delete            -delete specified print job
  215.  
  216.     EXAMPLE:
  217.         view all print jobs on 4.64.115.255
  218.     net print \\4.64.115.255
  219.  
  220. 12) net computer is used to add a computer to the domain
  221.     \\computername        -specifies what computer we're talking about. can also use ip addresses.
  222.     /add            -add computer to domain
  223.  
  224. That's all this time. Now you know the most typical and useful commands for both local and remote administration.
  225. I'm sure you would've never thought Microsoft this helpful, but i found these in the Microsoft Help and Support Center. Also, someone with
  226. NT/9x please email me at splittingheadache@veganz.com and tell me if these commands are common to other Windows OS's. Thanks!
  227. *^_Hydoplaning&Toward&Infinity_^*
  228.     /domain            -remove from domain
  229.